- 5 minutes to read

Installing the Nodinite Log4Net Appender

Add centralized logging to your .NET Framework applications by installing the Nodinite Log4Net Appender NuGet package. This guide provides step-by-step instructions for installation using Visual Studio's NuGet Package Manager, the Package Manager Console, or the .NET CLI.

With this guide, you will:

  • ✅ Quickly install the NuGet package in your .NET Framework project
  • ✅ Automatically manage dependencies and versioning
  • ✅ Configure the appender for seamless integration with Nodinite
  • ✅ Start logging to Nodinite with minimal configuration

This guide shows you how to install the Nodinite Log4Net Appender NuGet package and perform basic configuration.
For detailed implementation examples, see the Implement in a new .NET application user guide.

Before you begin

Ensure you meet all prerequisites, including Visual Studio (2019 or later) and a .NET Framework 4.6.2+ project.

Step 1: Install the NuGet Package

Choose one of the following methods to install the Nodinite Log4Net Appender NuGet package in your project:

Option A: Visual Studio NuGet Package Manager (GUI)

  1. Open your .NET Framework project in Visual Studio
  2. Right-click on the project in Solution Explorer
  3. Select Manage NuGet Packages...
  4. Click the Browse tab
  5. Search for Nodinite.LogAgent.Log4NetAppender
  6. Select the package and click Install
  7. Accept any license agreements and dependency installations

Option B: Package Manager Console

  1. Open Visual Studio
  2. Go to Tools > NuGet Package Manager > Package Manager Console
  3. Run the following command:
Install-Package Nodinite.LogAgent.Log4NetAppender

Option C: .NET CLI

Open a command prompt or terminal in your project directory and run:

dotnet add package Nodinite.LogAgent.Log4NetAppender

What Gets Installed

The NuGet package automatically installs the following dependencies:

  • Nodinite.LogAgent.Log4NetAppender.dll - The main appender library
  • IBSS.Libraries.Contracts.LogRestApi.dll - Log API contracts
  • Apache log4net (if not already installed)
  • Required .NET dependencies (Newtonsoft.Json, System.Text.Json, etc.)

All dependencies are managed automatically by NuGet. The exact versions are determined by the package manifest and will be kept up to date when you update the package.

Step 2: Configure the Appender

Add or update your log4net.config file (or configure within App.config / Web.config) with the Nodinite appender configuration:

<log4net>
  <appender name="NodiniteLog4NetAppender" type="Nodinite.LogAgent.Log4NetAppender.NodiniteLog4NetAppender,Nodinite.LogAgent.Log4NetAppender">
    <!-- Nodinite Configuration -->
    <OriginalMessageType value="Nodinite.LogAgent.Log4NetAppender/2.0#DefaultMessageType" />
    <MessageTypeExtractFromBody value="false" />
    <LogAgentID value="101"/>
    <EventNumber value="0"/>
    <EndPointName value="My .NET Application"/>
    <EndPointUri value="myapp.company.local"/>
    <ProcessingUser value="SYSTEM"/>
    <ModuleType value=".NET Application"/>
    <ProcessName value="MyApp"/>
    <ProcessingMachineName value="APP-SERVER-01"/>
    <ProcessingModuleType value=".NET Framework"/>
    <ProcessingModuleName value="MyApplication"/>
    <LogApiServiceURI value="https://nodinite.company.local/Nodinite/LogAPI"/>
    <ApplicationInterchangeId value="{99106FF5-C7BB-4244-9EB7-F99040190F32}"/>
    <LocalInterchangeId value="{E4CDDF18-9925-4A79-8E9F-71BC0D4C5172}"/>
    <ServiceInstanceActivityId value="{E4CDDF18-9925-4A79-8E9F-71BC0D4C5173}"/>
  </appender>
  
  <root>
    <level value="INFO"/>
    <appender-ref ref="NodiniteLog4NetAppender"/>
  </root>
</log4net>

Important

Update the LogApiServiceURI value to point to your Nodinite Log API endpoint. Use HTTPS for production environments.

Tip

The configuration creates rich JSON Log Events that are sent to Nodinite. Customize values like EndPointName, ProcessingMachineName, and ModuleType to match your application and environment.

Key Configuration Parameters

Parameter Description Example
LogApiServiceURI URL of the Nodinite Log API endpoint https://nodinite.company.local/Nodinite/LogAPI
EndPointName Friendly name for your application Customer Portal API
EndPointUri Unique identifier for the application instance customerportal.prod.company.local
LogAgentID Unique ID for this log agent (obtain from Nodinite) 101
level Minimum log level to capture INFO, WARN, ERROR, DEBUG

For detailed configuration options, see the Configuration page.

Step 3: Initialize Log4Net in Your Application

Ensure Log4Net is configured to read your configuration file. Add this code to your application startup (e.g., Program.cs, Global.asax.cs, or Startup.cs):

For Console Applications

using log4net;
using log4net.Config;

// In Main method
XmlConfigurator.Configure(new FileInfo("log4net.config"));

For ASP.NET Applications

// In Global.asax.cs Application_Start
XmlConfigurator.Configure(new FileInfo(Server.MapPath("~/log4net.config")));

For ASP.NET Core / .NET Framework Hybrid

// In Startup.cs or Program.cs
XmlConfigurator.Configure(new FileInfo("log4net.config"));

Step 4: Verify Installation

Test that the appender is working correctly:

using log4net;

private static readonly ILog log = LogManager.GetLogger(typeof(Program));

public void TestLogging()
{
    log.Info("Test message from Nodinite Log4Net Appender");
    log.Warn("This is a warning");
    log.Error("This is an error", new Exception("Test exception"));
}

Check the Nodinite Log Views in the Web Client to verify that log events are being received.


Release Notes

Note

The Log4Net Appender is distributed as a NuGet package. Release notes and version history are maintained in the Nodinite Portal, not as a downloadable installation package.

View the latest release information, version history, and changelogs:

View Release Notes in Nodinite Portal

The Portal provides:

  • Current and historical version information
  • Feature additions and bug fixes
  • Breaking changes and migration guides
  • Compatibility notes

To check your installed version, view the package version in Visual Studio's NuGet Package Manager or check your project's .csproj file.


Support

If you encounter issues during installation, contact Support.

Note

Additional troubleshooting information may be available in the Windows Event Logs or in your application's log output.

Frequently asked questions

Find more solutions and answers in the Troubleshooting user guide for the Nodinite Log4Net Appender.


Next Step